package com.ruoyi.filingCabinet.service.impl;

import com.ruoyi.filingCabinet.domain.FilingCabinet;
import com.ruoyi.filingCabinet.mapper.FilingCabinetMapper;
import com.ruoyi.filingCabinet.service.IFilingCabinetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 档案柜Service业务层处理
 *
 * @author lijie
 * @date 2025-03-20
 */
@Service
public class FilingCabinetServiceImpl implements IFilingCabinetService {
    @Autowired
    private FilingCabinetMapper filingCabinetMapper;

    /**
     * 查询档案柜
     *
     * @param filingId 档案柜主键
     * @return 档案柜
     */
    @Override
    public FilingCabinet selectFilingCabinetByFilingId(Long filingId) {
        return filingCabinetMapper.selectFilingCabinetByFilingId(filingId);
    }

    /**
     * 查询档案柜列表
     *
     * @param filingCabinet 档案柜
     * @return 档案柜
     */
    @Override
    public List<FilingCabinet> selectFilingCabinetList(FilingCabinet filingCabinet) {
        return filingCabinetMapper.selectFilingCabinetList(filingCabinet);
    }

    /**
     * 新增档案柜
     *
     * @param filingCabinet 档案柜
     * @return 结果
     */
    @Override
    public int insertFilingCabinet(FilingCabinet filingCabinet) {
        return filingCabinetMapper.insertFilingCabinet(filingCabinet);
    }

    /**
     * 修改档案柜
     *
     * @param filingCabinet 档案柜
     * @return 结果
     */
    @Override
    public int updateFilingCabinet(FilingCabinet filingCabinet) {
        return filingCabinetMapper.updateFilingCabinet(filingCabinet);
    }

    /**
     * 批量删除档案柜
     *
     * @param filingIds 需要删除的档案柜主键
     * @return 结果
     */
    @Override
    public int deleteFilingCabinetByFilingIds(Long[] filingIds) {
        return filingCabinetMapper.deleteFilingCabinetByFilingIds(filingIds);
    }

    /**
     * 删除档案柜信息
     *
     * @param filingId 档案柜主键
     * @return 结果
     */
    @Override
    public int deleteFilingCabinetByFilingId(Long filingId) {
        return filingCabinetMapper.deleteFilingCabinetByFilingId(filingId);
    }
}
